﻿using System;
using System.IO;
using System.Collections.Generic;
using 树.控制台测试.测试类;

namespace 树
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello AVLTree!\n");

            Player[] players = new Player[]
            {
                new Player(0, ""),
                new Player(1, ""),
                new Player(2, ""),
                new Player(3, ""),
                new Player(4, ""),
                new Player(5, ""),
                new Player(6, ""),
                new Player(7, ""),
                new Player(8, ""),
                new Player(9, "")
            };

            BST<Player> tree = new BST<Player>();
            tree.Balance = true;
            BSTNode<Player> node1 = tree.Add(players[5]);
            tree.DebugPrint(1);
            BSTNode<Player> node2 = tree.Add(players[3]);
            tree.DebugPrint(1);
            BSTNode<Player> node3 = tree.Add(players[4]);
            tree.DebugPrint(1);
            tree.Add(players[6]);
            tree.DebugPrint(1);
            tree.Add(players[7]);
            tree.DebugPrint(1);
            //tree.Add(players[8]);
            //tree.DebugPrint(1);
            //tree.Add(players[2]);
            //tree.Add(players[1]);
            //tree.Add(players[9]);

            //Console.WriteLine("-------------------------------------------------");
            //Console.WriteLine("");
            //tree.DebugPrint(1);
            //Console.WriteLine("树高度: {0}", tree.Height);
            //Console.WriteLine("左高度: {0}", tree.HeightLeft);
            //Console.WriteLine("右高度: {0}", tree.HeightRight);
        }
    }
}
